package com.breadenglish.cms.api.app.dao.impl;

import com.breadenglish.cms.api.app.dao.WordDao;
import com.breadenglish.cms.api.app.domain.query.WordQuery;
import com.breadenglish.cms.api.app.mapper.WordMapper;
import com.breadenglish.cms.api.app.domain.db.Word;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;


/**
 * Word
 * <p/>
 * User: guoyao
 * DateTime: 2015-12-22 20:06:38
 */
@Service("wordDao")
public class WordDaoImpl implements WordDao {

    @Resource
    private WordMapper wordMapper;

    /**
     * 根据主键查询Word对象
     *
     * @param wordId
     * @return Word对象
     */
    @Override
    public Word selectByPrimaryKey(Long wordId) {
        return wordMapper.selectByPrimaryKey(wordId);
    }

    /**
     * 根据查询条件查询符合条件的Word对象
     *
     * @param word
     * @return 符合条件的Word对象List
     */
    @Override
    public List<Word> select(Word word) {
        return wordMapper.select(word);
    }

    /**
     * 根据主键删除Word对象
     *
     * @param wordId
     * @return 影响条件数
     */
    @Override
    public int deleteByPrimaryKey(Long wordId) {
        return wordMapper.deleteByPrimaryKey(wordId);
    }

    /**
     * 根据条件删除符合条件的Word对象
     *
     * @param word
     * @return 影响条件数
     */
    @Override
    public int delete(Word word) {
        return wordMapper.delete(word);
    }

    /**
     * 插入Word对象
     *
     * @param word
     * @return 影响条件数
     */
    @Override
    public int insert(Word word) {
        return wordMapper.insert(word);
    }

    /**
     * 更新Word对象
     *
     * @param word
     * @return 影响条件数
     */
    @Override
    public int update(Word word) {
        return wordMapper.update(word);
    }

    /**
     * 根据主键查询Word对象
     *
     * @param wordId
     * @return Word对象
     */
    @Override
    public WordQuery selectWordById(Long wordId) {
        return wordMapper.selectWordById(wordId);
    }

    @Override
    public List<WordQuery> queryWord(Word word) {
        return wordMapper.queryWord(word);
    }
}
